Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrTheQuyNganHang
    Private sohieu, tentk As String
    Private tungay As String
    Private denngay As String
    Private customerReport As ReportDocument

    Private Sub FrmCrTheQuyNganHang_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        frmLoading.Show()
        Dim sqlQuery As String = "SELECT * FROM tbl_dot_temp_thenganhang order by ngay"
        Dim data As DataTable = moduleReportConfig.GetDataTable(sqlQuery)
        Dim tienDauKy As Double = 0
        Try
            If data.Rows.Item(0).Item(1).ToString = "ZZZZZZZZ" Then
                tienDauKy = data.Rows.Item(0).Item(9)
            End If
        Catch ex As Exception
        End Try

        Dim reportPath = Application.StartupPath & "\" & "crTheQuyNganHang.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(data)
        customerReport.SetParameterValue("tungay", tungay)
        customerReport.SetParameterValue("denngay", denngay)
        customerReport.SetParameterValue("TSohieu", sohieu)
        customerReport.SetParameterValue("TTentk", tentk)
        customerReport.SetParameterValue("tienDauKy", tienDauKy)
        customerReport.SetParameterValue("ketoantruong", globalVariale.KETOANTRUONG)
        customerReport.SetParameterValue("giamdoc", globalVariale.TONGGIAMDOC)
        Me.CrNXTTongHopview.ReportSource = customerReport
        frmLoading.Close()
        frmLoading.Dispose()
    End Sub

    Public Sub setTuNgay(ByVal s As Date)
        tungay = s
    End Sub
    Public Sub setDenNgay(ByVal s As Date)
        denngay = s
    End Sub

    Public Sub setSohieu(ByVal s As String)
        sohieu = s
    End Sub
    Public Sub setTentk(ByVal s As String)
        tentk = s
    End Sub
End Class
